import { http } from '@/utils/http'

/**
 * 短租订单-订单详情
 */
export const shortorderdetail = (data: Object) => {
  return http({
    method: 'POST',
    url: '/V5/sOrder/detail',
    data,
  })
}
/**
 * 短租订单-换车记录
 */
export const shortorderreplaceList = (data: Object) => {
  return http({
    method: 'POST',
    url: '/V5/sOrder/replaceList',
    data,
  })
}
/**
 * 短租订单-续租记录
 */
export const shortorderreletList = (data: Object) => {
  return http({
    method: 'POST',
    url: '/V5/sOrder/reletList',
    data,
  })
}
/**
 * 短租订单-费用信息
 */
export const feeList = (data: Object) => {
  return http({
    method: 'POST',
    url: '/V5/sOrder/orderFeeList',
    data,
  })
}
/**
 * 短租订单-去确认
 */
export const toConfirm = (data: Object) => {
  return http({
    method: 'POST',
    url: '/V5/orderFee/toConfirm',
    data,
  })
}
/**
 * 短租订单-方式
 */
export const getAccountByPageData = (data: Object) => {
  // 忽略退款抵扣违约金,需要显示 => 请加字段frontIsIgnore
  if ([undefined, null].includes(data.frontIsIgnore)) {
    data.ignoreWays = ['-2']
  }
  return http({
    method: 'POST',
    url: '/V5/inExpAccount/getWayByType',
    data,
  })
}
/**
 * 短租订单-账号
 */
export const getAccountByWayAndType = (data: Object) => {
  return http({
    method: 'POST',
    url: '/V5/inExpAccount/getAccountByWayAndType',
    data,
  })
}
/**
 * 短租订单-确认费用
 */
export const confirmFee = (data: Object) => {
  return http({
    method: 'POST',
    url: '/V5/orderFee/confirm',
    data,
  })
}

